import Vue from 'vue';
import Router from 'vue-router';
const login = resolve => require(['@/page/login/login'], resolve)
const home = resolve => require(['@/page/home/home'], resolve)
const news = resolve => require(['@/page/news/news'], resolve)
const projects = resolve => require(['@/page/projects/projects'], resolve)
const project = resolve => require(['@/page/projects/project'], resolve)
const hero = resolve => require(['@/page/hero/hero'], resolve)
const person = resolve => require(['@/page/hero/person'], resolve)
const rank = resolve => require(['@/page/rank/rank'], resolve)
const changePwd = resolve => require(['@/page/changePwd/changePwd'], resolve)


Vue.use(Router)

export default new Router({
  mode: 'history',
  base:'/web', 
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
    	path: '/login',
    	name: 'login',
    	component: login
    },
    {
    	path: '/home',
    	name: 'home',
      component: home,
      children: [
        {
          path: 'news',
          name: 'news',
          component: news
        }
      ]
    },
    {
      path: '/projects',
      name: 'projects',
      component: projects,
      children: [
        {
          path: 'project',
          name: 'project',
          component: project
        }
      ]
    },
    {
      path: '/hero',
      name: 'hero',
      component: hero,
      children: [
        {
          path: 'person',
          name: 'person',
          component: person
        }
      ]
    },
    {
      path: '/rank',
      name: 'rank',
      component: rank
    },{
      path: '/changePwd',
      name: 'changePwd',
      component: changePwd
    }
  ]
})
